<%flags>
	inherit => '../autohandler_noview'
</%flags>

<%args>
	$name => undef
	$cat_id => undef
</%args>

<%init>
	my $error => undef;
	my $new_id = $m->comp('../dao/subcategory_dao.mi:create', fields => { name => $name, cat_id => $cat_id });
	if(defined $new_id) {
		$m->redirect('show.mc/' . $new_id);
	} else {
		$error = 1;
	}
</%init>

% if (defined $error) {
	<p>an error occured</p>
% }